package com.joker.aigc.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * Description: 角色枚举
 * Author: <a href="https://github.com/zongzibinbin">abin</a>
 * Date: 2023-03-19
 */
@AllArgsConstructor
@Getter
public enum UserFriendStatusEnum {
    //    APPLY(1, "申请好友"),
    FRIEND(1, "正常，已经是好友关系"),
    BLANK(2, "已经拉黑了，不能再次申请好友"),
    ;

    private final Integer id;
    private final String desc;

    private static final Map<Integer, UserFriendStatusEnum> cache;

    static {
        cache = Arrays.stream(UserFriendStatusEnum.values()).collect(Collectors.toMap(UserFriendStatusEnum::getId, Function.identity()));
    }

    public static UserFriendStatusEnum of(Integer type) {
        return cache.get(type);
    }
}
